od is an octal dumping program for Unix and Unix-like systems. It can also dump hexadecimal or decimal data.
od is one of the earliest Unix programs, having appeared in version 1 AT&T Unix. It is also specified in the POSIX standards (see external link below). The implementation for od used on Linux systems is usually provided by GNU Core Utilities.
Normally a dump of an executable file is very long. The head program prints out the first few lines of the output. Here is an example of a dump of the "Hello world" program, piped through head.
% od hello | head 0000000 042577 043114 000401 000001 000000 000000 000000 000000 0000020 000002 000003 000001 000000 101400 004004 000064 000000 0000040 003610 000000 000000 000000 000064 000040 000006 000050 0000060 000033 000030 000006 000000 000064 000000 100064 004004 0000100 100064 004004 000300 000000 000300 000000 000005 000000 0000120 000004 000000 000003 000000 000364 000000 100364 004004 0000140 100364 004004 000023 000000 000023 000000 000004 000000 0000160 000001 000000 000001 000000 000000 000000 100000 004004 0000200 100000 004004 002121 000000 002121 000000 000005 000000 0000220 010000 000000 000001 000000 002124 000000 112124 004004
and here is od used to diagnose the output of echo where the user types <kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">Ctrl</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">V</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">Ctrl</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">I</kbd> and <kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">Ctrl</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">V</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">Ctrl</kbd>+<kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-color: #f9f9f9; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;">C</kbd> after writing "Hello" to literal insert a tab and ^C character:
% echo "Hello ^C" | od -cb 0000000 H e l l o \t 003 \n 110 145 154 154 157 011 003 012 0000010
|